package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DzErshouMapper;
import com.ruoyi.system.domain.DzErshou;
import com.ruoyi.system.service.IDzErshouService;


import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.mapper.DzHuiyuanMapper;
import com.ruoyi.system.domain.DzHuiyuan;
import com.ruoyi.system.service.IDzHuiyuanService;

/**
 * 二手房Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-17
 */
@Service
public class DzErshouServiceImpl implements IDzErshouService 
{
    @Autowired
    private DzErshouMapper dzErshouMapper;

    @Autowired
    private ISysRoleService sysRoleService;

    @Autowired
    private IDzHuiyuanService dzHuiyuanService;

    /**
     * 查询二手房
     * 
     * @param esId 二手房主键
     * @return 二手房
     */
    @Override
    public DzErshou selectDzErshouByEsId(Long esId)
    {
        return dzErshouMapper.selectDzErshouByEsId(esId);
    }

    /**
     * 查询二手房列表
     * 
     * @param dzErshou 二手房
     * @return 二手房
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<DzErshou> selectDzErshouList(DzErshou dzErshou)
    {

        return dzErshouMapper.selectDzErshouList(dzErshou);
    }

    @Override
    public List<DzErshou> selectDzErshouListWeb(DzErshou dzErshou)
    {
        return dzErshouMapper.selectDzErshouList(dzErshou);
    }

    /**
     * 新增二手房
     * 
     * @param dzErshou 二手房
     * @return 结果
     */
    @Override
    public int insertDzErshou(DzErshou dzErshou)
    {
        dzErshou.setCreateTime(DateUtils.getNowDate());
        return dzErshouMapper.insertDzErshou(dzErshou);
    }

    /**
     * 修改二手房
     * 
     * @param dzErshou 二手房
     * @return 结果
     */
    @Override
    public int updateDzErshou(DzErshou dzErshou)
    {
        return dzErshouMapper.updateDzErshou(dzErshou);
    }

    /**
     * 批量删除二手房
     * 
     * @param esIds 需要删除的二手房主键
     * @return 结果
     */
    @Override
    public int deleteDzErshouByEsIds(Long[] esIds)
    {
        return dzErshouMapper.deleteDzErshouByEsIds(esIds);
    }

    /**
     * 删除二手房信息
     * 
     * @param esId 二手房主键
     * @return 结果
     */
    @Override
    public int deleteDzErshouByEsId(Long esId)
    {
        return dzErshouMapper.deleteDzErshouByEsId(esId);
    }
}
